package com.wjy.icu.domain;


public enum MqttUpEnum {

    link("01","连接指示"),
    mainTempSetting("02","主温度设定值"),
    buttomTempSetting("03","底部温度设定值"),
    humiditySetting("04","湿度设定值"),
    oxygenConcentrationSetting("05","氧气设定值"),
    cycleState("06","内外循环控制"),
    negativeIonSwitch("07","负离子控制"),
    uv("08","UV灯"),
    floodlight("09","照明灯控制"),
    inspectionLamp("0A","检查灯控制"),
    petSite("0B","宠物测量位置切换"),
    atomizerTreatmentTime("0C","雾化时间"),
    infraredPhysiotherapyTime("0D","红外时间"),
    regulationMode0("A0","自动模式"),
    regulationMode1("A1","预设模式"),
    regulationModeSetting("B1","预设模式设置");


    private String code;
    private String msg;

    public String getMsg() {
        return msg;
    }

    public String getCode() {
        return code;
    }

    MqttUpEnum(String code, String value ) {
        this.msg = value;
        this.code = code;
    }
    // 此方法是关键
    public static MqttUpEnum getByCode(String code) {
        for (MqttUpEnum rebateItemTypeEnum : values()) {
            if (rebateItemTypeEnum.getCode().equalsIgnoreCase(code)) {
                return rebateItemTypeEnum;
            }
        }
        return null;
    }
    // 此方法是关键
    public static MqttUpEnum getByValue(String value) {
        for (MqttUpEnum rebateItemTypeEnum : values()) {
            if (rebateItemTypeEnum.getMsg().equals(value)) {
                return rebateItemTypeEnum;
            }
        }
        return null;
    }
}
